<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns or creates the default event loop.</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evloop.construct.html">EvLoop::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evloop.embed.html">EvLoop::embed</a></div>
 <div class="up"><a href="class.evloop.html">EvLoop</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="evloop.defaultloop" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">EvLoop::defaultLoop</h1>
  <p class="verinfo">(PECL ev &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">EvLoop::defaultLoop</span> &mdash; <span class="dc-title">Returns or creates the default event loop.</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-evloop.defaultloop-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="modifier">static</span>
   <span class="type"><a href="class.evloop.html" class="type EvLoop">EvLoop</a></span> 
   <span class="methodname"><strong>EvLoop::defaultLoop</strong></span>
    ([ <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$flags</code>
    <span class="initializer"> = Ev::FLAG_AUTO</span>
   </span>
   [, <span class="methodparam">
    <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span>
     <code class="parameter">$data</code>
    <span class="initializer"> = NULL</span>
   </span>
   [, <span class="methodparam">
    <span class="type">double</span>
     <code class="parameter">$io_interval</code>
    <span class="initializer"> = 0.</span>
   </span>
   [, <span class="methodparam">
    <span class="type">double</span>
     <code class="parameter">$timeout_interval</code>
    <span class="initializer"> = 0.</span>
   </span>
  ]]]] )</div>

  <p class="para rdfs-comment">
   If the default event loop is not created,
   <span class="methodname"><strong>EvLoop::defaultLoop()</strong></span>
   creates it with the specified parameters. Otherwise, it just returns the
   object representing previously created instance ignoring all the
   parameters.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-evloop.defaultloop-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>

     <em><code class="parameter">flags</code></em>
    </dt>

    <dd>

     <p class="para">
      One of the
      <a href="class.ev.html#ev.constants.loop-flags" class="link">event loop flags</a>
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">data</code></em>
    </dt>

    <dd>

     <p class="para">
      Custom data to associate with the loop.
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">io_collect_interval</code></em>
    </dt>

    <dd>

     <p class="para">
      See
      <a href="class.evloop.html#evloop.props.io-interval" class="link">io_interval</a>
     </p>
    </dd>

   
   
    <dt>

     <em><code class="parameter">timeout_collect_interval</code></em>
    </dt>

    <dd>

     <p class="para">
      See
      <a href="class.evloop.html#evloop.props.timeout-interval" class="link">timeout_interval</a>
     </p>
    </dd>

   
  </dl>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-evloop.defaultloop-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns EvLoop object on success.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-evloop.defaultloop-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member">
    <span class="methodname"><a href="evloop.construct.html" class="methodname" rel="rdfs-seeAlso">EvLoop::__construct()</a> - Constructs the event loop object</span>
   </li>
  </ul>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evloop.construct.html">EvLoop::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evloop.embed.html">EvLoop::embed</a></div>
 <div class="up"><a href="class.evloop.html">EvLoop</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
